package csu.web.credit_bank.controller;
import csu.web.credit_bank.service.LikedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/liked")
@CrossOrigin
public class LikedController {
    @Autowired
    private LikedService likedService;
    @GetMapping("{postId}/{userId}")
    public ResponseEntity<Boolean> getLiked(@PathVariable String postId, @PathVariable String userId) {
        return ResponseEntity.ok(likedService.getLiked(postId, userId));
    }
}
